in reply to blocking IPs
If you don't want to use a database, I'd say go for a number of files, not just a single big one. You could use a number of files like ipblock_001.txt, ipblock_002.txt and so on, where the number is the least significant byte in the IP address. This way, IP address entries should be evenly distribuited among multiple files and you'll have less concurrency on the same file and much shorter access times. You should also prepare a job to 'purge' files of stale IP entries, unless you want to rewrite each file from scratch on every write access.
A format for each file could be:
ip-address picture-code timestamp-vote
I'll assume you have the votes also in another file, as the content of this files will be rotated on an hourly basis. When a vote is cast, you read this file and determine whether you have a vote for this picture in the last hour; if you do, you print an error message; if you don't, you add an entry.
Hope this helps